package cn.jyc.ssm03.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

//    create TABLE sys_news (
//        id int auto_increment COMMENT '新闻ID',
//        title VARCHAR(32) not NULL COMMENT '新闻标题',
//        content text COMMENT '新闻内容',
//        createtime DATETIME COMMENT '时间',
//        auther VARCHAR(32) COMMENT '作者',
//        PRIMARY KEY(id)
//        ) charset=utf8;

public class News {
    private Integer id;
    private String title;
    private String content;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createtime;
    private String auther;
    private Integer type;

    public News() {
    }

    public News(Integer id, String title, String content, Date createtime, String auther, Integer type) {
        this.id = id;
        this.title = title;
        this.content = content;
        this.createtime = createtime;
        this.auther = auther;
        this.type = type;
    }

    @Override
    public String toString() {
        return "News{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", createtime=" + createtime +
                ", auther='" + auther + '\'' +
                ", type=" + type +
                '}';
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public String getAuther() {
        return auther;
    }

    public void setAuther(String auther) {
        this.auther = auther;
    }

}


